package de.joergviola.mobj.client.remote;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;

import de.joergviola.mobj.shared.ObjectNotFoundException;
import de.joergviola.mobj.shared.Persistable;
import de.joergviola.mobj.shared.Query;
import de.joergviola.mobj.shared.UnknownEntityException;

public interface RemoteTransaction extends RemoteService {

	<T extends Persistable> T insert(T t);

	<T extends Persistable> void update(T t);

	<T extends Persistable> T get(String className, Long id)
			throws ObjectNotFoundException, UnknownEntityException;

	<T extends Persistable> List<T> get(String className, List<Long> ids)
			throws ObjectNotFoundException, UnknownEntityException;

	<T extends Persistable> List<T> find(String className, Query query)
			throws ObjectNotFoundException, UnknownEntityException;

	<T extends Persistable> void delete(T t);
}
